package javatest3.ForWhileTest.test6;

import java.util.Scanner;

public class method2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int sum=0;
        while (num>=10){
            sum+=num%10;
            num=num/10;
        }
        System.out.println(sum);
    }
}
